package 抽象;
/*
* 编写一个Employee类，声明为抽象类
* 包含如下三个属性 name,id ,salary.
* 提供必要的构造器和抽象方法:work().
* */
public abstract class Employee {
    private String name;
    private int id;
    private double salary;
    public Employee(){
        super();
    }
    public Employee(String name,int id,double salary){
        super();
        this.name=name;
        this.id=id;
        this.salary= salary;
    }

    public abstract void work();

}

class Manager extends Employee{
    private double bonus;//奖金
    public Manager(){
    }
    public Manager(double bonus){
        super();
        this.bonus=bonus;
    }
    public Manager(String name,int id, double salary, double bonus){
        super(name,id,salary);
    }
    @Override
    public void work() {
        System.out.println("管理员工，提高公司云心的效率");
    }
}
class CommonEmployee extends Employee{

    @Override
    public void work() {
        System.out.println("员工在一线城建生产产品");
    }
}
class EmployeeTest{
    public static void main(String[] args) {
        //多态
        Employee manager=new Manager("库克",1001,1500,5000);
        manager.work();
        Employee commonEmployee = new CommonEmployee();
        commonEmployee.work();

    }
}

